<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>打开app</title>

        <!-- 移动端适配 -->
        <script src="__STATIC__/web/index/sweepcode/js/public.js"></script>

        <script src="__STATIC__/web/index/sweepcode/js/jquery.js"></script>
        <style type="text/css">

            .weixin-tip img{max-width: 100%; height: auto;}
            .weixin-tip{display: none; position: fixed; left:0; top:0; bottom:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80);  height: 100%; width: 100%; z-index: 100;}
            .weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}
        </style>

    </head>
    <body>
        <div class="weixin-tip">
            <p>
                <img src="__STATIC__/web/H5/item/img/android_weixin.png" alt="微信打开" id="imgId" style=" width: 100%"/>
            </p>
        </div>
        <script>
            window.onload = function () {
                var ua = navigator.userAgent.toLowerCase();
                var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
                var winHeight = $(window).height();
                var store_id = "{$id}";
                var ctm_phone = "{$phone}";
                if ((navigator.userAgent.match(/(iPhone|iPod|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) {
                    if (userAgent.indexOf("Safari") <= -1) {
                        $("#imgId").attr('src', "__STATIC__/web/H5/item/img/iphone_weixin.png");
                        $(".weixin-tip").css("height", winHeight);
                        $(".weixin-tip").show();
                        die;
                    }
                    location.href = 'kkmapp://storeoa.app/openwith?store_id=' + store_id + '&ctm_phone=' + ctm_phone;
                    window.setTimeout(function () {
                        location.href = "https://itunes.apple.com/cn/app/ke-ke-mei/id1050527415?mt=8";
                    }, 30)
                } else {
                    if (ua.match(/MicroMessenger/i) == "micromessenger") {
                        $("#imgId").attr('src', "__STATIC__/web/H5/item/img/android_weixin.png");
                        $(".weixin-tip").css("height", winHeight);
                        $(".weixin-tip").show();
                        die;
                    }
                    location.href = 'kkmapp://storeoa.app/openwith?store_id=' + store_id + '&ctm_phone=' + ctm_phone;
                    window.setTimeout(function () {
                        location.href = "http://android.myapp.com/myapp/detail.htm?apkName=com.XinSmartSky.kekemei";
                    }, 30)
                }
            };
        </script>
    </body>

</html>